package com.success.application.base;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import butterknife.ButterKnife;

/**
 * Created by ChrisWong on 2017/1/17.
 */
public abstract class BaseActivity<T> extends AppCompatActivity {

    protected abstract int getContentView();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initBundle(getIntent().getExtras());
        setContentView(getContentView());
        onBindViewBefore();
        ButterKnife.bind(this);
        initWidget();
        initData();
    }

    protected void onBindViewBefore() {
        // ...
    }

    protected boolean initBundle(Bundle bundle){
        return false;
    }

    protected void initWidget() {

    }

    protected void initData() {

    }
}
